package com.banmao.c01_factory_method.factory;

import com.banmao.c01_factory_method.vehicle.Vehicle;
import com.banmao.c01_factory_method.vehicle.plane.AirPlane;
import com.banmao.c01_factory_method.vehicle.plane.Jet;

public class PlaneFactory extends VehicleFactory {

    @Override
    Vehicle newVehicle(String type) {
        Vehicle vehicle = null;
        switch (type) {
            case "airplane": {
                vehicle = new AirPlane();
                break;
            }
            case "jet": {
                vehicle = new Jet();
                break;
            }
            default: {
                vehicle = new AirPlane();
            }
        }
        return vehicle;
    }

}
